package com.custom.session;


import com.custom.config.XMLConfigBuilder;
import com.custom.pojo.Configuration;
import org.dom4j.DocumentException;

import java.beans.PropertyVetoException;
import java.io.InputStream;

public class SqlSessionFactoryBuilder {



    public SqlSessionFactory builder(InputStream inputStream) throws PropertyVetoException, DocumentException {
        XMLConfigBuilder xmlConfigBuilder=new XMLConfigBuilder();
        Configuration configuration=xmlConfigBuilder.parseConfig(inputStream);

        DefaultSqlSessionFactory defaultSqlSessionFactory=new DefaultSqlSessionFactory(configuration);
        return defaultSqlSessionFactory;
    }


}
